﻿<?php 
mysql_connect ("localhost","igor","igor");
mysql_select_db ("simple blog");
if(isset($_GET['id'])) {$id = $_GET['id'];} 


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>блог</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="79" border="0" align="center" cellpadding="0" cellspacing="0" class="main_border">
  <tr>
    <td><a href='index.php'><img src="img/header-woman.jpg" width="960" height="200" /></a></td>
  </tr>
  <tr>
    <td valign="top" bgcolor="#B0C4DE"><div align="justify" >

     <?php $result = mysql_query("SELECT * FROM main WHERE id=$id");
     $myrow = mysql_fetch_array ($result);
	 
	 
	 print <<<HERE
	  <form action="add_article.php" method="post" name="form1" class="p" id="form1">
            <p>
              <label>Название<br />
                <input value= "$myrow[title]" type="text" name="title" id="title" />
                
              </label>
            </p>
            <p>
             
              
             
              <label>Введите полный текст поста<br />
                <textarea name="text" id="text" cols="40" rows="20">$myrow[text]</textarea>
                
              </label>
            </p>
            <p>
              <label>Введите автора <br />
            <input value= "$myrow[author]" type="text" name="author" id="author" />
            
              </label>
            </p>
            <p>
              <label>
                <input type="submit" name="submit" id="submit" value="Сохранить изменения" />
              </label>
            </p> <input name="id" type="hidden" value="$id" />
          </form>
HERE;
     ?>
	  
	</p>
      </div></td>
  </tr>
  <tr>
    <td><img src="img/iuh.jpg" width="960" height="28" /></td>
  </tr>
</table>


</body>
</html>